<script>
    function getDayNum(c){
        var d=new Date(c)
        return d.getDate()
    }
    alert(getDayNum('2019-1-2'))
</script>